home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / LFixedSizeArray 1.0 / LFixedSizeArray.cp next >
Encoding:
Text File  |  1996-05-24  |  1.1 KB  |  76 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        LFixedSizeArray.cp
  3.     
  4.     Contains:    LArray template wrapper class.
  5.     
  6.     Version:    1.0
  7.     
  8.     Copyright:    ©1996 Chris K. Thomas.  All Rights Reserved.
  9. */
  10.  
  11. #include "LFixedSizeArray.h"
  12.  
  13. //
  14. // instance lifetimes
  15. //
  16.  
  17. template <class T>
  18. LFixedSizeArray<T>::LFixedSizeArray()
  19. :LArray(sizeof(T))
  20. {
  21.     
  22. }
  23.  
  24. template <class T>
  25. LFixedSizeArray<T>::LFixedSizeArray(T **inHandle)
  26. :LArray(sizeof(T), (Handle)inHandle)
  27. {
  28.     
  29. }
  30.  
  31.  
  32. template <class T>
  33. LFixedSizeArray<T>::~LFixedSizeArray()
  34. {
  35.     
  36. }
  37.  
  38. //
  39. // Accessors
  40. //
  41.  
  42. template <class T>
  43. void
  44. LFixedSizeArray<T>::InsertItem(ArrayIndexT inAtIndex, T& inItem)
  45. {
  46.     LArray::InsertItemsAt(1, inAtIndex, &inItem);
  47. }
  48.  
  49. template <class T>
  50. void
  51. LFixedSizeArray<T>::RemoveItem(ArrayIndexT inAtIndex)
  52. {
  53.     LArray::RemoveItemsAt(1, inAtIndex);
  54. }
  55.  
  56. template <class T>
  57. void
  58. LFixedSizeArray<T>::SetItem(ArrayIndexT inAtIndex, T& inItem)
  59. {
  60.     AssignItemsAt(1, inAtIndex, &inItem);
  61. }
  62.  
  63. template <class T>
  64. Boolean
  65. LFixedSizeArray<T>::GetItem(ArrayIndexT inAtIndex, T& outItem)
  66. {
  67.     return FetchItemAt(inAtIndex, &outItem);
  68. }
  69.  
  70. template <class T>
  71. UInt32
  72. LFixedSizeArray<T>::GetCount()
  73. {
  74.     return LArray::GetCount();
  75. }
  76.